About      Forum      Issues      Tutorials      Documentation </span>

Tutorial 1: Making a molecule

This notebook gets you started with MDT - you'll build a small molecule, visualize it, and run a basic calculation.

1. Import the toolkit

This cell loads the toolkit and its unit system.


In [ ]:
import moldesign as mdt
import moldesign.units as u

A. Optional: Set up your computing backend

By default, MDT is configured to use Autodesk's free demo cluster on the cloud. However, if you'd like to run jobs elsewhere (e.g., on your local computer, on your private cloud cluster, etc.), you can set that up by running mdt.configure().


In [ ]:
mdt.configure()

2. Read in the molecule

This notebook comes with a few molecular files ready to go.

Here, we'll use mdt.read function to read one of them:


In [ ]:
molecule = mdt.read('data/butane.xyz')

Executing a notebook cell with just the molecule at the end will display some useful information:


In [ ]:
molecule

3. Draw it

The molecule has three built-in drawing functions - draw, draw2d, and draw3d. Try them out!


In [ ]:
molecule.draw()

4. Simulate it

Next, we'll run a Hartree-Fock calculation on our molecule to get its energy.


In [ ]:
molecule.set_energy_model(mdt.models.RHF, basis='sto-3g')
properties = molecule.calculate()

In [ ]:
print properties.keys()
print 'Energy: ', properties['potential_energy']

In [ ]:
molecule.draw_orbitals()

5. Minimize it


In [ ]:
mintraj = molecule.minimize()

In [ ]:
mintraj.draw_orbitals()

6. Write it


In [ ]:
molecule.write('my_first_molecule.xyz')

In [ ]:
mintraj.write('my_first_minimization.P.gz')

7. Play with it

There are any number of directions to go from here. Try playing with the molecular geometry here and see how it affect's the molecule's energy.


In [ ]:
mdt.widgets.GeometryBuilder(molecule)

In [ ]:
molecule.calculate_potential_energy()